Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (Relation): add safe navigator operator after scopes for respond_to_missing? and method_missing methods #287

Conversation

Thornolf
Copy link

@Thornolf Thornolf commented Aug 3, 2023

Hello !

In our attempt to move our project to Ruby 3.2.2 we encountered an error : MethodError: undefined method 'key?' for nil:NilClass, the origin of the error was from relation.rb:173, our class did not had any scopes and so it was sending this error. We had multiples ideas to fix the issue but the simplest one was to just add a safe navigator operator. What do you think about that ? I'm available if you need me to do any other modifications.

Thank you !

@flavorjones
Copy link
Collaborator

@Thornolf Thank you for pointing out this issue and suggesting a fix!

Would you mind adding a test case that demonstrates the issue, to prevent regressions?

@Thornolf
Copy link
Author

Thornolf commented Aug 7, 2023

@Thornolf Thank you for pointing out this issue and suggesting a fix!

Would you mind adding a test case that demonstrates the issue, to prevent regressions?

Sure ! I will do it as soon as possible :) Thank you for the review !

@kbrock
Copy link
Collaborator

kbrock commented Aug 11, 2023

Thanks you @Thornolf

It looks like #278 was the same fix.
I just merged that not knowing that this was also available.

I am closing this one as duplicate, but please let me know if you have other concerns

@kbrock kbrock closed this Aug 11, 2023
@Thornolf
Copy link
Author

Oh indeed, sorry for the delay I was a bit busy at work 😅 I did not even saw the PR myself sorry for creating this duplicate ! Thank you for merging it 💪🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants